import cv2


img = cv2.imread('opencv-logo.png')
gary = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# 平均滤波
blur_equal = cv2.blur(img, (5, 5))
# 高斯滤波
blur_gauss = cv2.GaussianBlur(img,(5,5),0)
# 中值滤波
blur_median = cv2.medianBlur(img,5)

cv2.imshow("img", img)
cv2.imshow("blur_equal", blur_equal)
cv2.imshow("blur_gauss", blur_gauss)
cv2.imshow("blur_median", blur_median)

cv2.waitKey()
cv2.destroyAllWindows()
